project(PoleBalancing)

find_package(Qt4)
find_package(OpenGL)
find_package(GLUT)

file(GLOB pb_src "*.cpp")

if(QT_FOUND AND GLUT_FOUND AND GLUT_Xmu_LIBRARY AND NOT CYGWIN_FOUND)
  set(QT_USE_QTMAIN TRUE)
  set(QT_USE_QTOPENGL TRUE)
  include(${QT_USE_FILE})
  add_definitions("${OPENANN_COMPILER_FLAGS} ${QT_DEFINITIONS} -DUSE_QT")
  qt4_wrap_cpp(MOC_OUTPUT_DPB DoublePoleBalancingVisualization.h)
  include_directories(${QT_LIB_DIR})
  add_executable(PoleBalancing ${pb_src} ${MOC_OUTPUT_DPB})
  target_link_libraries(PoleBalancing openann ${QT_LIBRARIES} ${GLUT_LIBRARY} ${OPENGL_LIBRARY})
else()
  if(NOT QT_FOUND)
    message(WARNING "Qt4 is missing, cannot build PoleBalancing example")
  endif()
  if(NOT GLUT_FOUND)
    message(WARNING "GLUT is missing, cannot build PoleBalancing example")
  endif()
endif()
